package com.jk.dmsearchprovider.controller;

import com.jk.dmcommon.djhEntity.CityEntity;
import com.jk.dmcommon.djhEntity.GoodsTypeEntity;
import com.jk.dmcommon.entity.ShopEntity;
import com.jk.dmsearchprovider.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("searchProvider")
public class SearchController {

    @Autowired
    private SearchService searchService;

    /**
     * chengshi
     * @return
     */
    @RequestMapping("selectAllCity")
    public List<CityEntity> selectAllCity(){
        return searchService.selectAllCity();
    }
    /**
     * leixing
     */
    @RequestMapping("selectAllType")
    public List<GoodsTypeEntity> selectAllType(){
        return searchService.selectAllType();
    }
    /**
     * 查询商品
     */
    @RequestMapping("selectGoodsByType")
    public List<ShopEntity> selectGoodsByType(String cityId, String typeId, String timeShow ,String searchButtongoods,Integer orderdesc){
        return searchService.selectGoodsByType(cityId,typeId,timeShow,searchButtongoods,orderdesc);
    }
    /**
     * 查询个数
     */
    @RequestMapping("selectGoodsCount")
    public Integer selectGoodsCount(String cityId, String typeId, String timeShow ,String searchButtongoods,Integer orderdesc){
        return searchService.selectGoodsCount(cityId,typeId,timeShow,searchButtongoods,orderdesc);
    }

}
